#include "pre-deal.hpp"


//检测环境亮度
bool checkLighting(Mat& img) {
    Mat gray;
    cvtColor(img, gray, COLOR_BGR2GRAY);

    Scalar meanValue = mean(gray);
    bool goodLighting = true;

    if (meanValue[0] < 50) {
        putText(img, "?????????????????", Point(30, 30), FONT_HERSHEY_SIMPLEX, 1, Scalar(0, 0, 255), 2);
        goodLighting = false;
    } else if (meanValue[0] > 200) {
        putText(img, "?????????????????", Point(30, 30), FONT_HERSHEY_SIMPLEX, 1, Scalar(0, 0, 255), 2);
        goodLighting = false;
    }

    return goodLighting;
}
